#ifndef _BUFFWINDOW_H_
#define _BUFFWINDOW_H_

#include <interfacelib/window/window.h>
#include <interfacelib/directx/vertexbufferManager.h>

namespace interfacelib
{
	namespace Window
	{
#define		MAX_VERTEX_BUFFER_COUNT		12
#define		RIGHT_DIRECTION				1
#define		LEFT_DIRECTION				-1

		class BuffWindow : public interfacelib::Window::Window
		{
		private:

		public:
			BuffWindow();
			virtual ~BuffWindow();

			virtual bool create(const char *filename, int x, int y, DWORD attribute = MOVABLE | VISIBLE );
			virtual void draw( Window *window = NULL );

			void start( DWORD timer , bool rightDirection = true );
		private:
			bool makeVertexBuffer();
			void makeVertexBufferByCase();

			void makeVertexBuffer1();
			void makeVertexBuffer2();
			void makeVertexBuffer3();
			void makeVertexBuffer4();
			void makeVertexBuffer5();
			void makeVertexBuffer6();
			void makeVertexBuffer7();
			void makeVertexBuffer8();

			VERTEX_PCT m_vertex[ MAX_VERTEX_BUFFER_COUNT ];
			int m_pointCount;
			DWORD m_color;

			SIZE m_size;
			POINT m_center;
			POINT m_posLeftTop;
			POINT m_posRightBottom;
			LONG m_totalDistance;

			LONG m_accumDistance;
			DWORD m_totalTime;
			DWORD m_startTime;

			int m_direction;

			bool m_isBuff;
		
			interfacelib::DirectX::VertexBufferManager::VertexBuffer *m_vertexBuffer;	
		};
	};
};
#endif